package com.igeekhome.wzgl.controller;

import com.igeekhome.wzgl.entity.MaterialInboundEntity;
import com.igeekhome.wzgl.service.IMaterialInbound;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/mi")
@CrossOrigin
public class MaterialInboundController {
    @Autowired
    private IMaterialInbound iMaterialInbound;
    @GetMapping("/page")
    public List<MaterialInboundEntity> page(){return iMaterialInbound.page();}
    @PostMapping("/insert")
    public int insert(@RequestBody MaterialInboundEntity mi){
        return iMaterialInbound.insert(mi);
    }
    @GetMapping("/delete")
    public int delete(@RequestParam int id){
        return iMaterialInbound.delete(id);
    }
    @PostMapping("/update")
    public int update(@RequestBody MaterialInboundEntity mi){
        return iMaterialInbound.update(mi);
    }
    @GetMapping("/select")
    public List<MaterialInboundEntity> select(@RequestParam int id){
        return iMaterialInbound.select(id);
    }
    @GetMapping("/getById")
    public MaterialInboundEntity getById(@RequestParam int id){
        return iMaterialInbound.getById(id);
    }
}
